/*
 * @Author: Vorga
 * @LastEditors: Vorga
 */
#ifndef LINK_GRAPH_H
#define LINK_GRAPH_H

#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <stdbool.h>

typedef struct Edge{
    int index;
    struct Edge* next;
}Edge;

typedef struct Vertex{
    char vex;
    Edge* head;
}Vertex;

typedef struct LinkGraph{
    Vertex* vertex;
    size_t vexnum;
}LinkGraph;

LinkGraph* create_lgp(const char* str);

int _get_vex_lgp(LinkGraph* graph,char v);

Edge* create_eg_lgp(int index);

bool add_eg_lgp(LinkGraph* graph,char v1,char v2);

void bfs_lgp(LinkGraph* graph);

void traversal_lgp(LinkGraph* graph);

size_t vex_in_lgp(LinkGraph* graph,char v);

size_t vex_out_lgp(LinkGraph* graph,char v);

#endif // LINK_GRAPH_H
